package day6;

import java.util.Scanner;

/**
 * @Author juzipi
 * @Date 2021/6/9 10:12
 * @Info
 */
public class StudentDemo {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("输入学生人数: ");
        int i = scanner.nextInt();

        int[] ints = new int[i];
        int max = 0;
        System.out.println("请输入"+ i +"个学生的成绩:");
        for (int i1 = 0; i1 < ints.length; i1++) {
            int i2 = scanner.nextInt();
            ints[i1] = i2;
            if (max < ints[i1]){
                max = ints[i1];
            }
        }

        String level = "";
        for (int j = 1; j < ints.length; j++) {
            if (max - ints[j] <= 10){
                level = "A";
            }else if (max - ints[j] <= 20){
                level = "B";
            }else if (max - ints[j] <= 30){
                level = "C";
            }else {
                level = "D";
            }
            System.out.println("学生"+j+"成绩"+ints[j]+"等级"+level);
        }


    }

}
